package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import org.springframework.stereotype.Service;

import com.iwhalecloud.bss.kite.client.api.scene.operate.IOperateSceneCommonService;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.PlatformServiceLevelAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;

import com.ztesoft.bss.common.util.SpringUtil;

@Service
@AttrHandler(PlatformServiceLevelAttrHandler.class)
public class PlatformServiceLevelAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr attr, KiteInst inst, AttrData data) {

    }

    @Override
    public void handleStyle(KiteAttr attr, KiteInst inst, AttrData data) {
        if (!"100006417".equals(attr.getValue())) {
            return;
        }
        IQuerySceneInstService querySceneInstService = SpringUtil.getBean(IQuerySceneInstService.class);
        KiteAttr tempAttr = querySceneInstService.getCommonAttr(data.getSceneInstId(), "10004282");
        if (tempAttr != null) {
            tempAttr.setIsEdit("F");
            SpringUtil.getBean(IOperateSceneCommonService.class).setCommonAttr(data.getSceneInstId(), tempAttr);

        }
    }
}
